﻿/*******************************************************************\
| Author(s):    Gary Kelly gkelly2008@my.fit.edu                    |
| Date:         Oct 27, 2011                                        |
| Class:        MyClass                                             |
| Descr:        My class does this stuff                            |
\*******************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using log4net;
using log4net.Config;
using SaveAWatt.Console;

namespace SaveAWatt
{
    // Starting class for the SaveAWatt system
    //
    public class SaveAWatt
    {
        // Logger
        //
        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public static void Main(string[] args)
        {
            m_log.InfoFormat("[SaveAWatt] Starting SaveAWatt system...");

            // See if we are set to run in the background
            // --Change this to utilize a config file
            bool background = false;

            if (background)
            {
                //class for running in background
            }
            else
            {
                //run .Startup() code

                while (true)
                {
                    try
                    {
                        CmdPrompt.Instance.Prompt();
                    }
                    catch (Exception e)
                    {
                        m_log.ErrorFormat("Command error: {0}", e);
                    }
                }
            }
        }
    }
}
